/*
 * BinaryXorOperatorAst.cpp
 *
 *  Created on: 1 Nov 2010
 *      Author: ph1109
 */

#include <MAlice/Ast/BinaryXorOperatorAst.h>

namespace MAlice {

BinaryXorOperatorAst::BinaryXorOperatorAst(ExpressionAst* lhs,
		ExpressionAst* rhs) : BinaryOperatorAst("^", lhs, rhs) {}

BinaryXorOperatorAst::~BinaryXorOperatorAst() {

}

llvm::Value* BinaryXorOperatorAst::generate()
{
	llvm::Value* LHS = getLHS()->generate();
	llvm::Value* RHS = getRHS()->generate();

	checkType(LHS, RHS);

	Builder* builder = MAlice::Codegen::get()->getBuilder();

	return builder->CreateXor(LHS, RHS);
}

}
